#pragma once
#include <stdio.h>
#include "Factory.h"

class Base {
public:
	Base() { printf("base class is created\n"); };
	virtual ~Base() {};
	virtual void work() { printf("base class is work\n"); }
};

#define REGISTER_CLASS(_class) \
static Base* create() { \
	return new _class(); \
} \
void register##_class() { \
	Factory::getInstance()->registerClass(#_class, create); \
}

#define DO_REGISTER_CLASS(_class) \
	extern void register##_class(); \
	register##_class();